Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: aggregations in structured views #62

Merged
merged 23 commits into from
Aug 29, 2024
Merged

Conversation

PatrykWyzgowski
Copy link
Contributor

No description provided.

@PatrykWyzgowski PatrykWyzgowski self-assigned this Jun 24, 2024
Copy link

Trivy scanning results.

@micpst micpst changed the title Pw/add single aggregation feat: aggregations in structured views Jun 24, 2024
@micpst micpst added the feature New feature or request label Jun 24, 2024
@micpst micpst linked an issue Jun 24, 2024 that may be closed by this pull request
Copy link

github-actions bot commented Jul 12, 2024

badge

Code Coverage Summary

Filename                                                  Stmts    Miss  Cover    Missing
------------------------------------------------------  -------  ------  -------  ---------------------------------------------------------------------
dbally/_main.py                                              13       1  92.31%   10
dbally/_types.py                                              8       1  87.50%   24
dbally/exceptions.py                                          1       0  100.00%
dbally/assistants/base.py                                    24       0  100.00%
dbally/assistants/openai.py                                  59       2  96.61%   59-76
dbally/audit/event_tracker.py                                36       8  77.78%   38-40, 53, 64, 74, 91, 97
dbally/audit/events.py                                       34       0  100.00%
dbally/audit/spans.py                                         7       0  100.00%
dbally/audit/event_handlers/base.py                          15       0  100.00%
dbally/audit/event_handlers/buffer_event_handler.py           8       0  100.00%
dbally/audit/event_handlers/cli_event_handler.py             56      35  37.50%   11-13, 47-55, 65-66, 79-98, 120-127, 138-145
dbally/audit/event_handlers/langsmith_event_handler.py       29      25  13.79%   6-106
dbally/audit/event_handlers/otel_event_handler.py            74      27  63.51%   19, 123, 126, 138-139, 159-179, 191-199, 209-219, 222-223
dbally/collection/collection.py                             126       3  97.62%   136, 153, 325
dbally/collection/exceptions.py                              13       0  100.00%
dbally/collection/results.py                                 14       0  100.00%
dbally/embeddings/base.py                                     5       0  100.00%
dbally/embeddings/exceptions.py                              15       6  60.00%   10-11, 20, 29-30, 39
dbally/embeddings/litellm.py                                 28      12  57.14%   7-8, 44, 68-84
dbally/gradio/gradio_interface.py                           111     111  0.00%    1-301
dbally/iql/_exceptions.py                                    49       1  97.96%   74
dbally/iql/_processor.py                                     94       5  94.68%   21, 82, 97, 170, 176
dbally/iql/_query.py                                         24       1  95.83%   9
dbally/iql/_type_validators.py                               38       2  94.74%   24, 28
dbally/iql/syntax.py                                         36       9  75.00%   6-9, 27, 36, 60, 63-66
dbally/iql_generator/iql_generator.py                        69       5  92.75%   247-249, 315-316
dbally/iql_generator/prompt.py                               33       2  93.94%   40, 69
dbally/llms/base.py                                          28       1  96.43%   34
dbally/llms/litellm.py                                       24      10  58.33%   8-9, 48-54, 61, 78
dbally/llms/local.py                                         18      18  0.00%    1-60
dbally/llms/clients/base.py                                  23       2  91.30%   46-47
dbally/llms/clients/exceptions.py                            15       6  60.00%   10-11, 20, 29-30, 39
dbally/llms/clients/litellm.py                               44      21  52.27%   8-9, 65-71, 97-120
dbally/llms/clients/local.py                                 33      33  0.00%    1-95
dbally/nl_responder/nl_responder.py                          24       4  83.33%   74-85
dbally/nl_responder/prompts.py                               19       4  78.95%   64-67
dbally/prompt/elements.py                                    25       1  96.00%   29
dbally/prompt/template.py                                    65       8  87.69%   33, 41, 49, 96, 110, 127, 153, 205
dbally/similarity/chroma_store.py                            37       0  100.00%
dbally/similarity/elastic_vector_search.py                   19      16  15.79%   5-102
dbally/similarity/elasticsearch_store.py                     22      19  13.64%   5-107
dbally/similarity/faiss_store.py                             38      35  7.90%    5-103
dbally/similarity/fetcher.py                                  5       0  100.00%
dbally/similarity/index.py                                   26       0  100.00%
dbally/similarity/sqlalchemy_base.py                         44      19  56.82%   35-37, 46, 68, 77, 86-89, 99-105, 123-126
dbally/similarity/store.py                                    7       0  100.00%
dbally/view_selection/base.py                                 7       0  100.00%
dbally/view_selection/llm_view_selector.py                   17       0  100.00%
dbally/view_selection/prompt.py                               9       0  100.00%
dbally/view_selection/random_view_selector.py                10      10  0.00%    1-36
dbally/views/base.py                                         16       1  93.75%   52
dbally/views/decorators.py                                   11       0  100.00%
dbally/views/exceptions.py                                    7       3  57.14%   20-22
dbally/views/exposed_functions.py                            33       1  96.97%   24
dbally/views/methods_base.py                                 41       2  95.12%   85, 93
dbally/views/pandas_base.py                                  52       1  98.08%   97
dbally/views/sqlalchemy_base.py                              40       7  82.50%   64, 79-82, 99-103
dbally/views/structured.py                                   49       1  97.96%   77
dbally/views/freeform/text2sql/config.py                     21       1  95.24%   47
dbally/views/freeform/text2sql/exceptions.py                  7       3  57.14%   12-14
dbally/views/freeform/text2sql/prompt.py                     11       0  100.00%
dbally/views/freeform/text2sql/view.py                       93      22  76.34%   49, 52, 55, 58, 61, 73, 151, 155-158, 161, 191, 206-207, 215, 228-233
dbally_cli/main.py                                            5       5  0.00%    1-13
dbally_cli/text2sql.py                                       94      94  0.00%    1-248
dbally_codegen/autodiscovery.py                             122      18  85.25%   54-57, 241-243, 264-278, 281-284, 353-354, 450-455
dbally_codegen/generator.py                                 175       7  96.00%   81, 91, 314, 342, 360, 374, 420
TOTAL                                                      2355     629  73.29%

Diff against main

Filename                                 Stmts    Miss  Cover
-------------------------------------  -------  ------  --------
dbally/iql/_processor.py                   +10       0  +0.63%
dbally/iql/_query.py                        +7       0  +1.71%
dbally/iql_generator/iql_generator.py      +22       0  +3.39%
dbally/iql_generator/prompt.py              +7      +1  -2.21%
dbally/prompt/template.py                    0      +1  -1.54%
dbally/views/decorators.py                  +5       0  +100.00%
dbally/views/exceptions.py                  -1      -1  +7.14%
dbally/views/methods_base.py                +7       0  +1.00%
dbally/views/pandas_base.py                +18       0  +1.02%
dbally/views/sqlalchemy_base.py             -1       0  -0.43%
dbally/views/structured.py                  +2      -3  +6.47%
TOTAL                                      +76      -2  +0.98%

Results for commit: 74cabe2

Minimum allowed coverage is 60%

♻️ This comment has been updated with latest results

@PatrykWyzgowski PatrykWyzgowski force-pushed the pw/add-single-aggregation branch from 67b34fd to 6d66b00 Compare July 12, 2024 14:41
@PatrykWyzgowski PatrykWyzgowski marked this pull request as ready for review July 12, 2024 14:42
src/dbally/views/structured.py Outdated Show resolved Hide resolved
docs/how-to/views/custom.md Outdated Show resolved Hide resolved
@mhordynski mhordynski requested a review from ludwiktrammer July 15, 2024 06:59
docs/quickstart/quickstart_code.py Outdated Show resolved Hide resolved
docs/quickstart/quickstart_code.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/iql_generator.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/iql_generator.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/prompt.py Outdated Show resolved Hide resolved
src/dbally/views/pandas_base.py Outdated Show resolved Hide resolved
src/dbally/views/sqlalchemy_base.py Outdated Show resolved Hide resolved
src/dbally/views/structured.py Outdated Show resolved Hide resolved
src/dbally/views/sqlalchemy_base.py Outdated Show resolved Hide resolved
src/dbally/views/sqlalchemy_base.py Outdated Show resolved Hide resolved
docs/quickstart/quickstart_code.py Outdated Show resolved Hide resolved
src/dbally/prompt/aggregation.py Outdated Show resolved Hide resolved
@micpst micpst linked an issue Aug 20, 2024 that may be closed by this pull request
Copy link
Contributor

@ludwiktrammer ludwiktrammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good in general - I have just a few small questions

src/dbally/iql_generator/iql_generator.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/prompt.py Show resolved Hide resolved
src/dbally/iql_generator/prompt.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/prompt.py Outdated Show resolved Hide resolved
src/dbally/views/methods_base.py Show resolved Hide resolved
src/dbally/views/pandas_base.py Outdated Show resolved Hide resolved
src/dbally/iql_generator/prompt.py Show resolved Hide resolved
src/dbally/views/structured.py Outdated Show resolved Hide resolved
src/dbally/views/sqlalchemy_base.py Outdated Show resolved Hide resolved
@micpst micpst merged commit 139ab9b into main Aug 29, 2024
3 checks passed
@micpst micpst deleted the pw/add-single-aggregation branch August 29, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add aggregation capabilities for pandas DataFrameBaseView feat: aggregations in structured views
4 participants